package cn.iocoder.yudao.module.erp.controller.admin.strategy.uniqueNo;

import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchaseorder.PurchaseOrderDO;
import cn.iocoder.yudao.module.erp.dal.mysql.purchaseorder.PurchaseOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
/**
 * @author Max-u-19
 */
@Component("UniquePurchaseNo")
@Slf4j
public class UniquePurchaseNo implements UniqueNoStrategy{

    @Resource
    private PurchaseOrderMapper purchaseOrderMapper;
    @Override
    public Boolean uniqueNo(String no) {
        PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectByNo(no);
        return ObjUtil.isNotEmpty(purchaseOrderDO);
    }
}
